<?php
/*
 * Copyright (c) 2023. ogg. Inc. All Rights Reserved.
 * ogg sit down and start building bugs in sunny weather.
 * Author: Ogg <baoziyoo@gmail.com>.
 * LastChangeTime: 2023-01-16 04:00:26
 * ChangeTime: 2023-04-26 10:21:32
 */

declare(strict_types=1);

namespace Hesb\LaravelPlus\Annotation\Rule;

use Attribute;

/**
 * 字段值需小于等于 value。字串、数字和文件则和 size 规则一致。
 */
#[Attribute(Attribute::TARGET_PROPERTY)]
class Max extends BaseValidation
{
    protected mixed $rule = 'max';

    public function __construct(int $value, string $messages = '')
    {
        $this->messages = $messages;
        $this->rule .= ':' . $value;
    }
}
